﻿using System;
using System.Collections.Generic;
using System.Text;
using CGLib.Enums;

namespace CGLib
{
    public static class ClientFunc
    {
        /// <summary>
        /// Send a quick sub-message to the game. This will display below the main message of the game.
        /// </summary>
        /// <param name="text">The text you want to display.</param>
        public static void SendSubMessage(string text)
        {
            GameEvents.OnClientFuncCalled(ClientCall.SubMsg, text);
        }

        /// <summary>
        /// Send a MSN text message.
        /// </summary>
        /// <param name="text">The text to send to the game.</param>
        /// <param name="tlcmsg">If true, the <see cref="GameEvents.MSNPacketReceived"/> will be triggered with information about the packet.</param>
        public static void SendMSNText(string text, bool tlcmsg)
        {
            if (tlcmsg)
                GameEvents.OnClientFuncCalled(ClientCall.SubMsg, "@TLC CUS " + tlcmsg);
            else
                GameEvents.OnClientFuncCalled(ClientCall.SubMsg, text);
        }

        /// <summary>
        /// Change part of the game property.
        /// </summary>
        /// <param name="changeType">The type of <see cref="ClientPropChange"/> you want to change.</param>
        /// <param name="info">The information with that type. Refer to the documentation of the selected enum on what type you should use.</param>
        public static void ChangeGameProperty(Enums.ClientPropChange changeType, object info)
        {
            GameEvents.OnClientPropChangeCalled(changeType, info);
        }
    }
}
